#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
配置模块
包含四足机器人轨迹规划程序的配置参数
"""

# 仿真配置
USE_GUI = True  # 是否使用GUI模式
USE_TK_INTERFACE = True  # 是否使用Tk界面
SIMULATION_STEP_TIME = 1/240  # 仿真步长

# URDF文件路径
URDF_FILE = "robot2.urdf"

# 轨迹可视化配置
ENABLE_TRAJECTORY_VIZ = True  # 是否启用轨迹可视化
MAX_TRAJ_SEGMENTS = 50  # 轨迹段最大数量
TRAJECTORY_LINE_COLOR = [0.2, 0.2, 1.0]  # 轨迹线颜色 [R, G, B]
TRAJECTORY_LINE_WIDTH = 1.5  # 轨迹线宽度

# 末端执行器标记配置
ENABLE_END_EFFECTOR_MARKERS = True  # 是否启用末端执行器标记
MARKER_COLOR = [1, 0, 0, 1]  # 标记颜色 [R, G, B, A]
MARKER_RADIUS = 0.01  # 标记半径

# 机器人初始位置
ROBOT_START_POS = [0, 0, 0.5]
ROBOT_START_ORI = [0, 0, 0]  # 欧拉角 [roll, pitch, yaw]

# 腿部参数
LEG_PARAMS = {
    "LF": {
        "center_x": -0.047, "center_y": 0.163, "base_z": -0.242,
        "long_axis": 0.075, "short_axis": 0.0, "height": 0.05,
        "direction": "Y", "phase_offset": 0.2 #  (0.5+0.3)+0.2 =1 抬脚  
    },
    "RF": {
        "center_x": 0.047, "center_y": 0.163, "base_z": -0.242,
        "long_axis": 0.075, "short_axis": 0.0, "height": 0.05,
        "direction": "Y", "phase_offset": 0.7 #  0+0.3+  0.7 = 1   
    },
    "LB": {
        "center_x": -0.047, "center_y": -0.08, "base_z": -0.242,
        "long_axis": 0.075, "short_axis": 0.0, "height": 0.05,
        "direction": "Y", "phase_offset": 0.5  #0.5抬脚 0.8落地
    },
    "RB": {
        "center_x": 0.047, "center_y": -0.08, "base_z": -0.242,
        "long_axis": 0.075, "short_axis": 0.0, "height": 0.05,
        "direction": "Y", "phase_offset": 0.0
    }
}

# 腿部ID到名称的映射
LEG_NAMES = {
    "LF": "左前腿", 
    "RF": "右前腿", 
    "LB": "左后腿", 
    "RB": "右后腿"
}

# 运动速度
MOVEMENT_SPEED = 0.5
